<template>
	<view>
		<view class="sug_cont" v-for="(item,index) in listdata" @click="detailFn(item)">
			<view class="sug_text">
				<view class="time">{{item.create}}</view>
				<view class="text">{{item.content}}</view>
			</view>
			<view class="sug_right">
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
		<u-empty v-if="isempty" margin-top="40" text="未反馈" mode="favor"></u-empty>
	</view>
</template>

<script>
	import {mysuggest} from '@/api/default.js'
	export default {
		data() {
			return {
				listdata:[],
				isempty:false
			};
		},
		onLoad() {
			this.mysuggestFn()
		},
		methods:{
			mysuggestFn(){
				mysuggest({page:1}).then(res=>{
					this.listdata=res.data
					if(this.listdata.length==0){
						this.isempty=true
					}
				})
			},
			detailFn(item){
				uni.navigateTo({
					url:'../sugdetail/sugdetail?item='+ encodeURIComponent(JSON.stringify(item))
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.sug_cont{
		padding:15px 20px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom:1rpx solid #b0b9cc;
		.time{
			font-size: 12px;
		}
		.text{
			font-size: 16px;
			margin-top: 10px;
		}
	}
</style>
